
local skill = fk.CreateSkill {
  name = "lvshi__duorui",
  tags = {"Turn"}
}

Fk:loadTranslationTable{
  ["lvshi__duorui"] = "夺锐",
  [":lvshi__duorui"] = "回合技，当牌于你的回合外进入中央区后，若中央区内的牌数量不小于你的手牌数，则你可获得当前回合角色的一张手牌。",

  ["$lvshi__duorui1"] = "力慑孙仲谋，威震逍遥津。",
  ["$lvshi__duorui2"] = "尔比之东吴十万大军如何？",
  ["$lvshi__zhiti1"] = "吴人惧我，如稚童之惧梦魇！",
  ["$lvshi__zhiti2"] = "张辽来也，还不速速逃命！",
}

local DIY = require "packages/diy_utility/diy_utility"

skill:addEffect(fk.AfterCardsMove, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skill.name) and player.room.current ~= player
    and player:usedSkillTimes(skill.name) == 0 and not player.room.current:isKongcheng() then
      for _, move in ipairs(data) do
        if move.toArea == Card.DiscardPile then
          return #DIY.getCenterCards(player.room) >= player:getHandcardNum()
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local id = player.room:askToChooseCard(player, {
      target = room.current,
      flag = "h",
      skill_name = skill.name,
    })
    player.room:obtainCard(player, id, false, fk.ReasonPrey, player, skill.name)
  end,
})

skill:addAcquireEffect(function (self, player, is_start)
  player.room:addSkill("#CenterArea")
end)

return skill